Scratch in waypoint proximity in Garmin GPX writer.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 16 Oct 2013 18:15:48 +0000 (18:15 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 16 Oct 2013 18:15:48 +0000 (18:15 +0000)
gpsbabel/gpx.cc

index c4ee42d5e23982cd86d1f8ffc6b64fe14744f99d..818644105e944d74130bbb533f89f2a9f9d04889 100644 (file)
@@ -1477,7 +1477,7 @@ gpx_write_common_extensions(const waypoint* waypointp, const gpx_point_type poin
 {
   // gpx version we are writing is >= 1.1.
   if ((opt_humminbirdext && (WAYPT_HAS(waypointp, depth) || WAYPT_HAS(waypointp, temperature))) ||
-      (opt_garminext && gpxpt_waypoint==point_type && (WAYPT_HAS(waypointp, temperature) || WAYPT_HAS(waypointp, depth))) ||
+      (opt_garminext && gpxpt_waypoint==point_type && (WAYPT_HAS(waypointp, proximity) || WAYPT_HAS(waypointp, temperature) || WAYPT_HAS(waypointp, depth))) ||
       (opt_garminext && gpxpt_track==point_type && (WAYPT_HAS(waypointp, temperature) || WAYPT_HAS(waypointp, depth) || waypointp->heartrate != 0 || waypointp->cadence != 0))) {
     writer->writeStartElement("extensions");
 
@@ -1497,8 +1497,11 @@ gpx_write_common_extensions(const waypoint* waypointp, const gpx_point_type poin
       // Although not required by the schema we assume that gpxtpx:TrackPointExtension must be a child of gpx:trkpt.
       switch (point_type) {
       case gpxpt_waypoint:
-        if (WAYPT_HAS(waypointp, temperature) || WAYPT_HAS(waypointp, depth)) {
+        if (WAYPT_HAS(waypointp, proximity) || WAYPT_HAS(waypointp, temperature) || WAYPT_HAS(waypointp, depth)) {
           writer->writeStartElement("gpxx:WaypointExtension");
+          if (WAYPT_HAS(waypointp, proximity)) {
+            writer->writeTextElement("gpxx:Proximity", toString(waypointp->proximity));
+          }
           if (WAYPT_HAS(waypointp, temperature)) {
             writer->writeTextElement("gpxx:Temperature", toString(waypointp->temperature));
           }